﻿@using NewRen.Models;
@using NewRen.Models.ViewModel;
@model  NewRen.Models.UserGroup
@{
    UserGroup group = ViewBag.User as UserGroup;
    List<Industry> industries = ViewBag.Industry;
    ViewBag.Title = "牛棚信息修改-牛棚修改";
    Layout = "~/Views/Shared/_Layout_UserGroup.cshtml";
}
<script src="~/Scripts/jquery.datetimepicker.js"></script>
<div class="ucenter-left account-left-border">
    <div class="ucneter-l-head cf">
        <div class="ulhead-headicon">
            @if (group.Picture == null)
            {
                <img src="/Images/userphoto.png" width="50" height="50"
                     alt=@group.LoginName style="border-radius:50%;" />
            }
            else
            {
                <img src="/UserGroup/ShowPicture/@group.ID" width="50"
                     alt=@group.LoginName height="50" style="border-radius:50%;" />
            }

        </div>
        <div class="ulhead-info">
            <p class="ulhead-info-uname">@group.GroupName</p>

            <div class="ulhead-info-tool">
                <a class="ulhead-icon icon-lock ucenter-mail " href="/UserGroup/PwdEdit/@group.ID" title="修改密码">
                    <div class="ucenter-mail-tip">修改密码</div>
                </a>
                <a href="/UserGroup/Edit/@group.ID"
                   class="ulhead-icon icon-setting ucenter-mail" title="设置牛棚信息"></a>
            </div>
        </div>
    </div>
    <div class="ucenter-l-list">
        <ul class="ullist-ul">
            <li id="uclick">
                <a href="/UserGroup/Show/@group.ID">牛棚中心</a>
            </li>
            <li id="uclick1" class="active">
                <a href="/UserGroup/Edit/@group.ID">牛棚设置</a>
            </li>
            <li id="uclick2">
                <a href="/UserGroup/UserManager/@group.ID">牛棚牛人</a>
            </li>
        </ul>
    </div>
</div>
<div class="ucenter-right cf">
    <div class="ucenter-right-head">
        <span class="ucenter-right-head-selected"><a href="/UserGroup/Edit/@group.ID">信息修改</a></span>
        <span class="ucenter-right-head-show"><a href="/UserGroup/PwdEdit/@group.ID">密码修改</a></span>
        <span class="ucenter-right-head-show"><a href="/UserGroup/PictureEdit/@group.ID">更换头像</a></span>
        <span class="ucenter-right-head-show"><a href="/UserGroup/GroupPictureShow/@group.ID">宣传图片</a></span>
    </div>
    <div class="tabGroup">
        @using (Html.BeginForm("Edit", "UserGroup", new
        {
            HttpMethod = "post",
            onsunit = "return GroupEditCheck;",
        }))
        {
            @Html.AntiForgeryToken()
            @Html.HiddenFor(model => model.ID, new { @Value = group.ID })
            <div class=" form-item">
                <div class="item-label">
                    <label>牛棚名：</label>
                </div>
                <div class="item-span">
                    @Html.TextBoxFor(model => model.GroupName, new { @Value = group.GroupName, @class = "txt sm" })
                </div>
            </div>
            <div class=" form-item">
                <div class="item-label">
                    <label>电话：</label>
                </div>
                <div class="item-span">
                    @Html.TextBoxFor(model => model.Phone, new { @Value = group.Phone, @class = "txt sm" })
                </div>
            </div>
            <div class=" form-item">
                <div class="item-label">
                    <label>地址：</label>
                </div>
                <div class="item-span">
                    @Html.TextBoxFor(model => model.Address, new { @Value = group.Address, @class = "txt sm" })
                </div>
            </div>
            <div class="form-item">
                <div class="item-label">
                    <label>城市：</label>
                </div>
                <div class="item-span">
                    <select id="city" name="city" class="select">
                        @foreach (City item in ViewBag.Cities)
                        {
                            <option value="@item.CityName">@item.CityName</option>
                        }
                    </select>
                    <script>
                        if ("@group.City" != "") {
                            $("#city").val("@group.City");
                        }
                    </script>
                </div>
            </div>
            <div class=" form-item">
                <div class="item-label">
                    <label>邮件：</label>
                </div>
                <div class="item-span">
                    @Html.TextBoxFor(model => model.Email, new { @Value = group.Email, @class = "txt sm" })
                </div>
            </div>
            <div class=" form-item">
                <div class="item-label">
                    <label>微博：</label>
                </div>
                <div class="item-span">
                    @Html.TextBoxFor(model => model.Weibo, new { @Value = group.Weibo, @class = "txt sm" })
                </div>
            </div>
            <div class=" form-item">
                <div class="item-label">
                    <label>微信：</label>
                </div>
                <div class="item-span">
                    @Html.TextBoxFor(model => model.WhatApp, new { @Value = group.WhatApp, @class = "txt sm" })
                </div>
            </div>
            <div class="form-item">
                <div class="item-label">
                    <label>行业：</label>
                </div>
                <div class="item-span">
                    <select id="industry" name="Industry" class="select">
                        @foreach (Industry item in industries)
                        {
                            <option value="@item.IndustryName">@item.IndustryName</option>
                        }
                    </select>
                    <script>
                        if ("@group.Industry" != "") {
                            $("#industry").val("@group.Industry");
                        }
                    </script>
                </div>
            </div>
            <div class="form-item">
                <div class="item-label">
                    <label>自我描述：</label>
                </div>
                <div class="item-span">
                    <textarea class="resize-none" name="description" id="description">@group.Description</textarea>
                </div>
            </div>
            <div class="form-item">
                <div class="item-span">
                    <input type="submit" value="保存" class="btn">
                    <span class="defInfo">@Html.ValidationSummary(true)</span>
                </div>
            </div>
        }
    </div>
</div>